home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / PRG / PL 2.0 SupplementDoc Folder.sit / PL 2.0 SupplementDoc Folder / Documentation / Chapter 21. Streams < prev    next >
Text File  |  1995-03-27  |  25KB  |  612 lines

  1. Common Lisp the Language, 2nd Edition
  2. -------------------------------------------------------------------------------
  3.  
  4. 21. Streams
  5.  
  6. Streams are objects that serve as sources or sinks of data. Character streams
  7. produce or absorb characters; binary streams produce or absorb integers. The
  8. normal action of a Common Lisp system is to read characters from a character
  9. input stream, parse the characters as representations of Common Lisp data
  10. objects, evaluate each object (as a form) as it is read, and print
  11. representations of the results of evaluation to an output character stream.
  12.  
  13. Typically streams are connected to files or to an interactive terminal.
  14. Streams, being Lisp objects, serve as the ambassadors of external devices by
  15. which input/output is accomplished.
  16.  
  17. A stream, whether a character stream or a binary stream, may be input-only,
  18. output-only, or bidirectional. What operations may be performed on a stream
  19. depends on which of the six types of stream it is.
  20.  
  21. -------------------------------------------------------------------------------
  22.  
  23.    *  Standard Streams
  24.    *  Creating New Streams
  25.    *  Operations on Streams
  26.  
  27. -------------------------------------------------------------------------------
  28.  
  29. 21.1. Standard Streams
  30.  
  31. There are several variables whose values are streams used by many functions in
  32. the Lisp system. These variables and their uses are listed here. By convention,
  33. variables that are expected to hold a stream capable of input have names ending
  34. with -input, and variables that are expected to hold a stream capable of output
  35. have names ending with -output. Variables expected to hold a bidirectional
  36. stream have names ending with -io.
  37.  
  38. [Variable]
  39. *standard-input*
  40.  
  41. In the normal Lisp top-level loop, input is read from *standard-input* (that
  42. is, whatever stream is the value of the global variable *standard-input*). Many
  43. input functions, including read and read-char, take a stream argument that
  44. defaults to *standard-input*.
  45.  
  46. [Variable]
  47. *standard-output*
  48.  
  49. In the normal Lisp top-level loop, output is sent to *standard-output* (that
  50. is, whatever stream is the value of the global variable *standard-output*).
  51. Many output functions, including print and write-char, take a stream argument
  52. that defaults to *standard-output*.
  53.  
  54. [Variable]
  55. *error-output*
  56.  
  57. The value of *error-output* is a stream to which error messages should be sent.
  58. Normally this is the same as *standard-output*, but *standard-output* might be
  59. bound to a file and *error-output* left going to the terminal or to a separate
  60. file of error messages.
  61.  
  62. [Variable]
  63. *query-io*
  64.  
  65. The value of *query-io* is a stream to be used when asking questions of the
  66. user. The question should be output to this stream, and the answer read from
  67. it. When the normal input to a program may be coming from a file, questions
  68. such as ``Do you really want to delete all of the files in your directory?''
  69. should nevertheless be sent directly to the user; and the answer should come
  70. from the user, not from the data file. For such purposes *query-io* should be
  71. used instead of *standard-input* and *standard-output*. *query-io* is used by
  72. such functions as yes-or-no-p.
  73.  
  74. [Variable]
  75. *debug-io*
  76.  
  77. The value of *debug-io* is a stream to be used for interactive debugging
  78. purposes. This is often the same as the value of *query-io*, but need not be.
  79.  
  80. [Variable]
  81. *terminal-io*
  82.  
  83. The value of *terminal-io* is ordinarily the stream that connects to the user's
  84. console. Typically, writing to this stream would cause the output to appear on
  85. a display screen, for example, and reading from the stream would accept input
  86. from a keyboard.
  87.  
  88. It is intended that standard input functions such as read and read-char, when
  89. used with this stream, would cause ``echoing'' of the input into the output
  90. side of the stream. (The means by which this is accomplished are of course
  91. highly implementation-dependent.)
  92.  
  93. [Variable]
  94. *trace-output*
  95.  
  96. The value of *trace-output* is the stream on which the trace function prints
  97. its output.
  98.  
  99. The variables *standard-input*, *standard-output*, *error-output*,
  100. *trace-output*, *query-io*, and *debug-io* are initially bound to synonym
  101. streams that pass all operations on to the stream that is the value of
  102. *terminal-io*. (See make-synonym-stream.) Thus any operations performed on
  103. those streams will go to the terminal.
  104.  
  105. [change_begin]
  106. X3J13 voted in January 1989 (STANDARD-INPUT-INITIAL-BINDING)   to replace the
  107. requirements of the preceding paragraph with the following new requirements:
  108.  
  109. The seven standard stream variables, *standard-input*, *standard-output*,
  110. *query-io*, *debug-io*, *terminal-io*, *error-output*, and *trace-output*, are
  111. initially bound to open streams. (These will be called the standard initial
  112. streams.)
  113.  
  114. The streams that are the initial values of *standard-input*, *query-io*,
  115. *debug-io*, and *terminal-io* must support input.
  116.  
  117. The streams that are the initial values of *standard-output*, *error-output*,
  118. *trace-output*, *query-io*, *debug-io*, and *terminal-io* must support output.
  119.  
  120. None of the standard initial streams (including the one to which *terminal-io*
  121. is initially bound) may be a synonym, either directly or indirectly, for any of
  122. the standard stream variables except *terminal-io*. For example, the initial
  123. value of *trace-output* may be a synonym stream for *terminal-io* but not a
  124. synonym stream for *standard-output* or *query-io*. (These are examples of
  125. direct synonyms.) As another example, *query-io* may be a two-way stream or
  126. echo stream whose input component is a synonym for *terminal-io*, but its input
  127. component may not be a synonym for *standard-input* or *debug-io*. (These are
  128. examples of indirect synonyms.)
  129.  
  130. Any or all of the standard initial streams may be direct or indirect synonyms
  131. for one or more common implementation-dependent streams. For example, the
  132. standard initial streams might all be synonym streams (or two-way or echo
  133. streams whose components are synonym streams) to a pair of hidden terminal
  134. input and output streams maintained by the implementation.
  135.  
  136. Part of the intent of these rules is to ensure that it is always safe to bind
  137. any standard stream variable to the value of any other standard stream variable
  138. (that is, unworkable circularities are avoided) without unduly restricting
  139. implementation flexibility.
  140. [change_end]
  141.  
  142. No user program should ever change the value of *terminal-io*. A program that
  143. wants (for example) to divert output to a file should do so by binding the
  144. value of *standard-output*; that way error messages sent to *error-output* can
  145. still get to the user by going through *terminal-io*, which is usually what is
  146. desired.
  147.  
  148. -------------------------------------------------------------------------------
  149.  
  150. 21.2. Creating New Streams
  151.  
  152. Perhaps the most important constructs for creating new streams are those that
  153. open files; see with-open-file and open. The following functions construct
  154. streams without reference to a file system.
  155.  
  156. [Function]
  157. make-synonym-stream symbol
  158.  
  159. make-synonym-stream creates and returns a synonym stream. Any operations on the
  160. new stream will be performed on the stream that is then the value of the
  161. dynamic variable named by the symbol. If the value of the variable should
  162. change or be bound, then the synonym stream will operate on the new stream.
  163.  
  164. [change_begin]
  165. X3J13 voted in January 1989 (STREAM-ACCESS)   to specify that the result of
  166. make-synonym-stream is always a stream of type synonym-stream. Note that the
  167. type of a synonym stream is always synonym-stream, regardless of the type of
  168. the stream for which it is a synonym.
  169. [change_end]
  170.  
  171. [Function]
  172. make-broadcast-stream &rest streams
  173.  
  174. This returns a stream that works only in the output direction. Any output sent
  175. to this stream will be sent to all of the streams given. The set of operations
  176. that may be performed on the new stream is the intersection of those for the
  177. given streams. The results returned by a stream operation are the values
  178. resulting from performing the operation on the last stream in streams; the
  179. results of performing the operation on all preceding streams are discarded. If
  180. no streams are given as arguments, then the result is a ``bit sink''; all
  181. output to the resulting stream is discarded.
  182.  
  183. [change_begin]
  184. X3J13 voted in January 1989 (STREAM-ACCESS)   to specify that the result of
  185. make-broadcast-stream is always a stream of type broadcast-stream.
  186. [change_end]
  187.  
  188. [Function]
  189. make-concatenated-stream &rest streams
  190.  
  191. This returns a stream that works only in the input direction. Input is taken
  192. from the first of the streams until it reaches end-of-file; then that stream is
  193. discarded, and input is taken from the next of the streams, and so on. If no
  194. arguments are given, the result is a stream with no content; any input attempt
  195. will result in end-of-file.
  196.  
  197. [change_begin]
  198. X3J13 voted in January 1989 (STREAM-ACCESS)   to specify that the result of
  199. make-concatenated-stream is always a stream of type concatenated-stream.
  200. [change_end]
  201.  
  202. [Function]
  203. make-two-way-stream input-stream output-stream
  204.  
  205. This returns a bidirectional stream that gets its input from input-stream and
  206. sends its output to output-stream.
  207.  
  208. [change_begin]
  209. X3J13 voted in January 1989 (STREAM-ACCESS)   to specify that the result of
  210. make-two-way-stream is always a stream of type two-way-stream.
  211. [change_end]
  212.  
  213. [Function]
  214. make-echo-stream input-stream output-stream
  215.  
  216. This returns a bidirectional stream that gets its input from input-stream and
  217. sends its output to output-stream. In addition, all input taken from
  218. input-stream is echoed to output-stream.
  219.  
  220. [change_begin]
  221. X3J13 voted in January 1989 (STREAM-ACCESS)   to specify that the result of
  222. make-echo-stream is always a stream of type echo-stream.
  223.  
  224. X3J13 voted in January 1989 (PEEK-CHAR-READ-CHAR-ECHO)   to clarify the
  225. interaction of read-char, unread-char, and peek-char with echo streams. (See
  226. the descriptions of those functions for details.)
  227.  
  228. X3J13 explicitly noted that the bidirectional streams that are the initial
  229. values of *query-io*, *debug-io*, and *terminal-io*, even though they may have
  230. some echoing behavior, conceptually are not necessarily the products of calls
  231. to make-echo-stream and therefore are not subject to the new rules about
  232. echoing on echo streams. Instead, these initial interactive streams may have
  233. implementation-dependent echoing behavior.
  234. [change_end]
  235.  
  236. [Function]
  237. make-string-input-stream string &optional start end
  238.  
  239. This returns an input stream. The input stream will supply, in order, the
  240. characters in the substring of string delimited by start and end; after the
  241. last character has been supplied, the stream will then be at end-of-file.
  242.  
  243. [change_begin]
  244. X3J13 voted in January 1989 (STREAM-ACCESS)   to specify that the result of
  245. make-string-input-stream is always a stream of type string-stream.
  246. [change_end]
  247.  
  248. [old_change_begin]
  249.  
  250. [Function]
  251. make-string-output-stream
  252.  
  253. This returns an output stream that will accumulate all output given it for the
  254. benefit of the function get-output-stream-string.
  255. [old_change_end]
  256.  
  257. [change_begin]
  258. X3J13 voted in June 1989 (MORE-CHARACTER-PROPOSAL)   to let
  259. make-string-output-stream take an :element-type argument.
  260.  
  261. [Function]
  262. make-string-output-stream &key :element-type
  263.  
  264. This returns an output stream that will accumulate all output given it for the
  265. benefit of the function get-output-stream-string.
  266.  
  267. The :element-type argument specifies what characters must be accepted by the
  268. created stream. If the :element-type argument is omitted, the created stream
  269. must accept all characters.
  270.  
  271. X3J13 voted in January 1989 (STREAM-ACCESS)   to specify that the result of
  272. make-string-output-stream is always a stream of type string-stream.
  273. [change_end]
  274.  
  275. [Function]
  276. get-output-stream-string string-output-stream
  277.  
  278. Given a stream produced by make-string-output-stream, this returns a string
  279. containing all the characters output to the stream so far. The stream is then
  280. reset; thus each call to get-output-stream-string gets only the characters
  281. since the last such call (or the creation of the stream, if no such previous
  282. call has been made).
  283.  
  284. [Macro]
  285. with-open-stream (var stream) {declaration}* {form}*
  286.  
  287. The form stream is evaluated and must produce a stream. The variable var is
  288. bound with the stream as its value, and then the forms of the body are executed
  289. as an implicit progn; the results of evaluating the last form are returned as
  290. the value of the with-open-stream form. The stream is automatically closed on
  291. exit from the with-open-stream form, no matter whether the exit is normal or
  292. abnormal; see close. The stream should be regarded as having dynamic extent.
  293.  
  294. [change_begin]
  295. X3J13 voted in January 1989 (STREAM-ACCESS)   to specify that the stream
  296. created by with-open-stream is always of type file-stream.
  297. [change_end]
  298.  
  299. [Macro]
  300.  
  301. with-input-from-string (var string keyword {value}*)
  302.          {declaration}* {form}*
  303.  
  304. The body is executed as an implicit progn with the variable var bound to a
  305. character input stream that supplies successive characters from the value of
  306. the form string. with-input-from-string returns the results from the last form
  307. of the body.
  308.  
  309. The input stream is automatically closed on exit from the
  310. with-input-from-string form, no matter whether the exit is normal or abnormal.
  311. The stream should be regarded as having dynamic extent.
  312.  
  313. [change_begin]
  314. X3J13 voted in January 1989 (STREAM-ACCESS)   to specify that the stream
  315. created by with-input-from-string is always of type string-stream.
  316. [change_end]
  317.  
  318. The following keyword options may be used:
  319.  
  320.      :index
  321.           The form after the :index keyword should be a place acceptable
  322.           to setf. If the with-input-from-string form is exited normally,
  323.           then the place will have stored into it the index into the
  324.           string indicating the first character not read (the length of
  325.           the string if all characters were used). The place is not
  326.           updated as reading progresses, but only at the end of the
  327.           operation.
  328.  
  329.      :start
  330.           The :start keyword takes an argument indicating, in the manner
  331.           usual for sequence functions, the beginning of a substring of
  332.           string to be used.
  333.  
  334.      :end
  335.           The :end keyword takes an argument indicating, in the manner
  336.           usual for sequence functions, the end of a substring of string
  337.           to be used.
  338.  
  339. Here is an example of the use of with-input-from-string:
  340.  
  341. (with-input-from-string (s "Animal Crackers" :index j :start 6)
  342.   (read s)) => crackers
  343.  
  344. As a side effect, the variable j is set to 15.
  345.  
  346. The :start and :index keywords may both specify the same variable, which is a
  347. pointer within the string to be advanced, perhaps repeatedly by some containing
  348. loop.
  349.  
  350. [change_begin]
  351. X3J13 voted in January 1989 (MAPPING-DESTRUCTIVE-INTERACTION)   to restrict
  352. user side effects; see section 7.9.
  353. [change_end]
  354.  
  355. [old_change_begin]
  356.  
  357. [Macro]
  358.  
  359. with-output-to-string (var [string]) {declaration}* {form}*
  360.  
  361. The body is executed as an implicit progn with the variable var bound to a
  362. character output stream. All output to that stream is saved in a string. This
  363. may be done in one of two ways.
  364.  
  365. If no string argument is provided, then the value of with-output-from-string is
  366. a string containing all the collected output.
  367.  
  368. If string is specified, it must be a string with a fill pointer; the output is
  369. incrementally appended to the string, as if using vector-push-extend if the
  370. string is adjustable, and otherwise as if using vector-push. In this case
  371. with-output-to-string returns the results from the last form of the body.
  372.  
  373. In either case, the output stream is automatically closed on exit from the
  374. with-output-from-string form, no matter whether the exit is normal or abnormal.
  375. The stream should be regarded as having dynamic extent.
  376. [old_change_end]
  377.  
  378. [change_begin]
  379. X3J13 voted in June 1989 (MORE-CHARACTER-PROPOSAL)   to let
  380. with-output-to-string take an :element-type argument.
  381.  
  382. [Macro]
  383.  
  384. with-output-to-string (var [string [:element-type type]])
  385.        {declaration}* {form}*
  386.  
  387. One may specify nil instead of a string as the string and use the :element-type
  388. argument to specify what characters must be accepted by the created stream. If
  389. no string argument is provided, or if it is nil and no :element-type is
  390. specified, the created stream must accept all characters.
  391.  
  392. X3J13 voted in October 1988 (WITH-OUTPUT-TO-STRING-APPEND-STYLE)   to specify
  393. that if string is specified, it must be a string with a fill pointer; the
  394. output is incrementally appended to the string (as if by use of
  395. vector-push-extend).
  396.  
  397. In this way output cannot be accidentally lost. This change makes
  398. with-output-to-string behave in the same way that format does when given a
  399. string as its first argument.
  400.  
  401. X3J13 voted in January 1989 (STREAM-ACCESS)   to specify that the stream
  402. created by with-output-to-string is always of type string-stream.
  403.  
  404. X3J13 voted in January 1989 (MAPPING-DESTRUCTIVE-INTERACTION)   to restrict
  405. user side effects; see section 7.9.
  406. [change_end]
  407.  
  408. -------------------------------------------------------------------------------
  409.  
  410. 21.3. Operations on Streams
  411.  
  412. This section contains discussion of only those operations that are common to
  413. all streams. Input and output is rather complicated and is discussed separately
  414. in chapter 22. The interface between streams and the file system is discussed
  415. in chapter 23.
  416.  
  417. [Function]
  418. streamp object
  419.  
  420. streamp is true if its argument is a stream, and otherwise is false.
  421.  
  422. (streamp x) == (typep x 'stream)
  423.  
  424. [change_begin]
  425. X3J13 voted in January 1989 (CLOSED-STREAM-OPERATIONS)   to specify that
  426. streamp is unaffected by whether its argument, if a stream, is open or closed.
  427. In either case it returns true.
  428. [change_end]
  429.  
  430. [change_begin]
  431.  
  432. [Function]
  433. open-stream-p stream
  434.  
  435. X3J13 voted in January 1989 (STREAM-ACCESS)   to add the predicate
  436. open-stream-p. It is true if its argument (which must be a stream) is open, and
  437. otherwise is false.
  438.  
  439. A stream is always created open; it remains open until closed with the close
  440. function. The macros with-open-stream, with-input-from-string,
  441. with-output-to-string, and with-open-file automatically close the created
  442. stream as control leaves their bodies, in effect imposing dynamic extent on the
  443. openness of the stream.
  444. [change_end]
  445.  
  446. [Function]
  447. input-stream-p stream
  448.  
  449. This predicate is true if its argument (which must be a stream) can handle
  450. input operations, and otherwise is false.
  451.  
  452. [Function]
  453. output-stream-p stream
  454.  
  455. This predicate is true if its argument (which must be a stream) can handle
  456. output operations, and otherwise is false.
  457.  
  458. [Function]
  459. stream-element-type stream
  460.  
  461. A type specifier is returned to indicate what objects may be read from or
  462. written to the argument stream, which must be a stream. Streams created by open
  463. will have an element type restricted to a subset of character or integer, but
  464. in principle a stream may conduct transactions using any Lisp objects.
  465.  
  466. [Function]
  467. close stream &key :abort
  468.  
  469. The argument must be a stream. The stream is closed. No further input/output
  470. operations may be performed on it. However, certain inquiry operations may
  471. still be performed, and it is permissible to close an already closed stream.
  472.  
  473. [change_begin]
  474. X3J13 voted in January 1989 (CLOSED-STREAM-OPERATIONS)   and revised the vote
  475. in March 1989 to specify that if close is called on an open stream, the stream
  476. is closed and t is returned; but if close is called on a closed stream, it
  477. succeeds without error and returns an unspecified value. (The rationale for not
  478. specifying the value returned for a closed stream is that in some
  479. implementations closing certain streams does not really have an effect on
  480. them-for example, closing the *terminal-io* stream might not ``really'' close
  481. it-and it is not desirable to force such implementations to keep otherwise
  482. unnecessary state. Portable programs will of course not rely on such behavior.)
  483.  
  484. X3J13 also voted in January 1989 to specify exactly which inquiry functions may
  485. be applied to closed streams:
  486.  
  487. streamp            pathname-host         namestring
  488. pathname           pathname-device       file-namestring
  489. truename           pathname-directory    directory-namestring
  490. merge-pathnames    pathname-name         host-namestring
  491. open               pathname-type         enough-namestring
  492. probe-file         pathname-version      directory
  493.  
  494. See the individual descriptions of these functions for more information on how
  495. they operate on closed streams.
  496.  
  497. X3J13 voted in January 1989 (CLOSE-CONSTRUCTED-STREAM)   to clarify the effect
  498. of closing various kinds of streams. First some terminology:
  499.  
  500.    *  A composite stream is one that was returned by a call to
  501.      make-synonym-stream, make-broadcast-stream, make-concatenated-stream,
  502.      make-two-way-stream, or make-echo-stream.
  503.  
  504.    *  The constituents of a composite stream are the streams that were given as
  505.      arguments to the function that constructed it or, in the case of
  506.      make-synonym-stream, the stream that is the symbol-value of the symbol
  507.      that was given as an argument. (The constituent of a synonym stream may
  508.      therefore vary over time.)
  509.  
  510.    *  A constructed stream is either a composite stream or one returned by a
  511.      call to make-string-input-stream, make-string-output-stream,
  512.      with-input-from-string, or with-output-to-string.
  513.  
  514. The effect of applying close to a constructed stream is to close that stream
  515. only. No input/output operations are permitted on the constructed stream once
  516. it has been closed (though certain inquiry functions are still permitted, as
  517. described above).
  518.  
  519. Closing a composite stream has no effect on its constituents; any constituents
  520. that are open remain open.
  521.  
  522. If a stream created by make-string-output-stream is closed, the result of then
  523. applying get-output-stream-string to the stream is unspecified.
  524. [change_end]
  525.  
  526. If the :abort parameter is not nil (it defaults to nil), it indicates an
  527. abnormal termination of the use of the stream. An attempt is made to clean up
  528. any side effects of having created the stream in the first place. For example,
  529. if the stream performs output to a file that was newly created when the stream
  530. was created, then if possible the file is deleted and any previously existing
  531. file is not superseded.
  532.  
  533. [change_begin]
  534. X3J13 voted in January 1989 (STREAM-ACCESS)   to add the following accessor
  535. functions for obtaining information about streams.
  536.  
  537. [Function]
  538. broadcast-stream-streams broadcast-stream
  539.  
  540. The argument must be of type broadcast-stream. A list of the constituent output
  541. streams (whether open or not) is returned.
  542.  
  543. [Function]
  544. concatenated-stream-streams concatenated-stream
  545.  
  546. The argument must be of type concatenated-stream. A list of constituent streams
  547. (whether open or not) is returned. This list represents the ordered set of
  548. input streams from which the concatenated stream may yet read; the stream from
  549. which it is currently reading is first in the list. The list may be empty if no
  550. more streams remain to be read.
  551.  
  552. [Function]
  553. echo-stream-input-stream echo-stream
  554. echo-stream-output-stream echo-stream
  555.  
  556. The argument must be of type echo-stream. The function echo-stream-input-stream
  557. returns the constituent input stream; echo-stream-output-stream returns the
  558. constituent output stream.
  559.  
  560. [Function]
  561. synonym-stream-symbol synonym-stream
  562.  
  563. The argument must be of type synonym-stream. This function returns the symbol
  564. for whose value the synonym-stream is a synonym.
  565.  
  566. [Function]
  567. two-way-stream-input-stream two-way-stream
  568. two-way-stream-output-stream two-way-stream
  569.  
  570. The argument must be of type two-way-stream. The function
  571. two-way-stream-input-stream returns the constituent input stream;
  572. two-way-stream-output-stream returns the constituent output stream.
  573.  
  574. [Function]
  575. interactive-stream-p stream
  576.  
  577. X3J13 voted in June 1989 (STREAM-CAPABILITIES)   to add the predicate
  578. interactive-stream-p, which returns t if the stream is interactive and
  579. otherwise returns nil. A type-error error is signalled if the argument is not
  580. of type stream.
  581.  
  582. The precise meaning of interactive-stream-p is implementation-dependent and may
  583. depend on the underlying operating system. The intent is to distinguish between
  584. interactive and batch (background, command-file) operations. Some
  585. characteristics that might distinguish a stream as interactive:
  586.  
  587.    *  The stream is connected to a person (or the equivalent) in such a way
  588.      that the program can prompt for information and expect to receive input
  589.      that might depend on the prompt.
  590.  
  591.    *  The program is expected to prompt for input and to support ``normal input
  592.      editing protocol'' for that operating environment.
  593.  
  594.    *  A call to read-char might hang waiting for the user to type something
  595.      rather than quickly returning a character or an end-of-file indication.
  596.  
  597. The value of *terminal-io* might or might not be interactive.
  598.  
  599. [Function]
  600. stream-external-format stream
  601.  
  602. X3J13 voted in June 1989 (MORE-CHARACTER-PROPOSAL)   to add the function
  603. stream-external-format, which returns a specifier for the
  604. implementation-recognized scheme used for representing characters in the
  605. argument stream. See the :external-format argument to open.
  606.  
  607. [change_end]
  608.  
  609. -------------------------------------------------------------------------------
  610.  
  611.  
  612.